<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>{$details['title']}</title>
    <meta name="keywords" content="重庆新闻,我爱大重庆,重庆,热点新闻,微信资讯" />
    <meta name="description" content="我爱大重庆资讯平台是我爱大重庆公众平台的附属产品，旨在为我爱大重庆的用户提供一个便捷的实时资讯浏览平台" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
    <style>
        body{
            background:#FFF;
        }
        .head{
            width:40px;
            height:40px;
            /*margin-top:0px;*/
            /*display: block;*/
            margin:0 auto;
            text-align: center;
        }
        .nickname{
            width:100%;
            display:block;
            margin:0 auto;
            text-align:center
        }
        embed{
            width:100% !important;
        }
        .content>p{
            padding-top:10px;
        }
        .content>p>img{
            width:100% !important;
        }
        blockquote {
            padding: 0px 5px;
            margin: 0 0 0px;
            font-size: 14px;
            border-left: 5px solid #eee;
            max-height: 60px;
            overflow: hidden;
        }
        .hidden-now{
            color: #FFF !important;
        }
        ul{
            list-style: none;
            padding-left:0;
            margin-left:0;
        }
        .content{
            margin:auto 3%;
            line-height: 1.8;
        }
        .content > img{
            width:100%;
        }
        .pl{
            width:100%;
            border-radius: 5px;
            margin:0 auto;
            box-shadow: 0px 0px 10px #777;
            margin-bottom: 35px;
            border-top: 2px solid red;
        }
        h3{
            padding:0;
            margin:3px;
            margin-left:10px;
            margin-top: 10px;
        }
        h4{
            margin-left:10px;
        }
        li{
            border-top:1px solid #CCC;
            border-bottom:1px solid #CCC;
            float: left;
            width:100%;
            padding-top: 10px;
            padding-bottom: 10px;
        }
        .right{
            float: right;
        }
        .up,.down{
            margin:0 10px;
            font-size:18px;
        }
        .yes-left{
            float: left;
            width:40px;
            height:40px;
            line-height: 40px;
            background: #5BC0DE;
            color:#FFF;
            text-align:center;
            border-radius: 100%;
        }
        .yes-right{
            float: right;
            width:40px;
            height:40px;
            line-height: 40px;
            background: #D9534F;
            color:#FFF;
            text-align:center;
            border-radius: 100%;
            transform: rotate(180deg);
            -ms-transform: rotate(180deg);
            -webkit-transform: rotate(180deg);
        }
        .progress{
            height: 30px;
            margin-bottom: 0;
        }
        .progress-bar{
            line-height: 30px;
            height:30px;
        }
        .progress-bottom{
            margin:20px auto;
            font-size:26px;
        }
        .button-width{
            width:100%;
            text-align:left;
            padding-left:0;
            margin-bottom: 0;
        }
        .button-width>button{
            border-top-left-radius: 0;
            border-top-right-radius: 0 !important;
            border-right:0 !important;
            height:40px;
            border-left:0 !important;
            padding-top:10px;
            padding-bottom: 10px;
            position: relative;
            line-height:40px;
            /*margin:5px auto;*/
        }
        .button-width>button>div{
            margin-left:20px;
        }
        .btn-default{
            text-align:left;
        }
        .footer{
            position: fixed;
            /*z-index: 99999;*/
            bottom: 0;
            width:100%;
            height:40px;
            box-shadow: 0px 0px 20px #777;
            background:#FFF;
        }
        .footer>button{
            width:100%;
            height: 40px;
            border:0;
            margin:0px auto;
        }
        .margin-bottom{
            height:30px;
        }
        .header{
            position: fixed;
            z-index: 9;
            top: 0;
            width:100%;
            height:40px;
            box-shadow: 0px 0px 20px #777;
            background:#FFF;
        }
        .header>button{
            width:100%;
            height: 40px;
            border:0;
            margin:0px auto;
        }
        #cover{
            display:none;
            position:absolute;
            left:0;
            top:0;
            z-index:29;
            background-color:#000000;
            opacity:0.7;
        }
        #guide{
            display:none;
            position:absolute;
            right:18px;
            top:5px;
            z-index:29;
        }
        #guide img{
            width: 230px;
            z-index:91;
        }
        .button-width > .tp-now > .progress{
            /*margin:10px auto;*/
            border-radius: 0;
            position: relative;
        }
        .button-width > .tp-now > .progress > .progress-bar{
            text-align:left !important;
        }
        .tp-now{
            margin:10px auto;
        }
        .tp-now label{
            padding-top:10px;
        }
        .people{
            position: absolute;
            right: 5px;
            top: 5px;
        }
        .content{
            font-size: 20px !important;
        }
        iframe{
            width:100% !important;
        }
        .replay{
            background:#F3F3F3;
            margin:0;
            padding:0;
            padding-left: 5px;
            padding-top:5px;
            margin-bottom: 10px;
        }
        .replay-name{
            font-size:12px;
            display:block
        }
        .replay-time{
            font-size:10px;
            float:left;
            width:auto;
            display:block
        }
        .replay-from{
            float:left;
            font-size:10px;
            margin-left:10px
        }
        .replay-p1{
            width: 100%;
            height:16px;
            margin-bottom: 5px;
        }
        .replay-content{
            float:left;
            font-size:14px;
            line-height: 1.5;
            margin-bottom: 5px;
            color:#666;
        }
        .button-top{
            width:100% !important;
            text-align: center
        }
        .share{
            border:0;
            border-radius:0;
            float:right;
            text-align: center;
            width:20% !important;
        }
        #textarea{
            width:100% !important;
        }
        #replay-label1{
            display: block !important;
        }
        .btn-reply{
            width:auto !important;
            border:0 !important;
            box-shadow: 0 0 0 !important;
            padding: 0 !important;
            background:#FFF;
        }
        .modal-body > ul{
            height:120px;
            display: block;
        }
        .modal-body > ul > li{
            float: left;
            width: 40px;
            height: 40px;
            margin:5px;
            border:1px solid red;
            /*display: block;*/
        }
    </style>
</head>

<body data-spy="scroll" data-target="#navbar-example">
<div id="cover"></div>
<div id="guide"><img src="__PUBLIC__/images/share.png"></div>

<div class="header">
    <button type="button" class="btn btn-default button-top">
        <span class="glyphicon glyphicon-eye-open"></span> 浏览量:{$details['see']} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <span class="glyphicon glyphicon-time"></span> 最后更新:{$LastTime|timeFormat=###}
    </button>
    <!--<button type="button" id="onMenuShareTimeline" class="btn btn-info share" onClick="_system._guide(true)">分享</button>-->
</div>

<div class="margin-bottom" style="height: 45px"></div>
<div class="container-fluid">
    <div class="row">
        <div class="col-lg-12">
            <div class="row">
                <h3>{$details['title']}</h3>
                <div class="content">
                    <img src="__PUBLIC__/images/share2.gif" width="100%">
                    {$content['content']}
                    <img src="__PUBLIC__/images/qrcode.gif" width="100%">
                    <p></p>
                    <img src="__PUBLIC__/images/share2.gif" width="100%">
                </div>

                <div class="col-xs-2 progress-bottom">
                    <span class="glyphicon glyphicon-thumbs-up right yes-left" aria-hidden="true"></span>
                </div>
                <div class="col-xs-8 progress-bottom" style="margin-top:26px;">
                    <div class="progress">
                        <div id="yes-left" data-click="0" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: <?php if($details['up'] == 0){echo '50%';}else{echo floor(($details['up']/($details['up']+$details['down']))*10000)/10000*100;} ?>%">
                            <span class="z">{$details['up']}</span>赞
                        </div>

                        <div id="yes-right"  data-click="0" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: <?php if($details['down'] == 0){echo '50%';}else{echo floor(($details['down']/($details['up']+$details['down']))*10000)/10000*100;} ?>%">
                            <span class="f" >{$details['down']}</span>踩
                        </div>
                    </div>
                </div>
                <div class="col-xs-2 progress-bottom">
                    <span class="glyphicon glyphicon-thumbs-up right yes-right" aria-hidden="true"></span>
                </div>
                <if condition="count($toupiao) gt 0">
                <div class="col-xs-12">

                    <div class="row pl" style="border-top:2px solid cornflowerblue">
                        <h4 style="margin-bottom:0;border-bottom: 2px solid #FFF">投票<span style="font-size: 14px">(<span id="jjj">{$count}</span>人参与)</span></h4>
                        <label style="margin-left: 10px;margin-top:5px;margin-bottom: 15px">{$content['votename']}</label>
                        <div data-click="0" data-count="60000" class="btn-group-vertical button-width" id="abc" role="group" aria-label="Vertical button group">
                            <foreach name="toupiao" item="toupiao">
                                <button data-id="{$toupiao['id']}" type="button" class="btn btn-default btn-click-tp">
                                    <div class="show-old" style="position: absolute;top: 0;left: 0;">
                                        {$toupiao['vote']}
                                    </div>
                                </button>
                            </foreach>
                        </div>
                    </div>
                </div>
                </if>
            </div>
            <div class="row pl">
                <h4 style="border-bottom: 2px solid #FFF">最热评论</h4>
                <div>
                    <ul>
                        <foreach name="bestc" item="bestc">
                            <li>
                                <div class="col-xs-2">
                                    <img src="{$bestc['userimg']}" alt="" title="" class="img-circle head">
                                </div>
                                <div class="col-xs-10">
                                    <label  class="nicknameaaa" style="margin-right:15px">{$bestc['nickname']|strCut=###,26}</label>
                                    <span class="" style="float: right;color:#AAA"><span class=" glyphicon glyphicon-map-marker"></span> 来自{$bestc['province']}</span>
                                    <?php reply($bestc['reply']) ?>
                                    <p class="user-content" style="float:left;margin-top:0px;">{$bestc['content']}</p>
                                </div>
                                <div class="col-xs-12">
                                    <span class="" style="color:#AAA">{$bestc['createtime']|timeFormat=###}</span>
                                    <span class="right math-right">{$bestc['up']}</span>
                                    <button data-type="up" data-id="{$bestc['id']}"  class="btn-reply click-up glyphicon glyphicon-thumbs-up right up" style="<?php if(cookie($bestc['id']) == 1){ echo 'color:red';}else{echo 'color:#333';} ?>" aria-hidden="true"></button>
                                    <button class="right click-reply btn-reply" data-toggle="modal" data-reply="{$bestc['id']}" data-reply-openid="{$bestc['openid']}" data-target="#replay">回复</button>
                                    <button  data-toggle="modal" data-target="#replay" data-type="up" data-reply-openid="{$bestc['openid']}" data-reply="{$bestc['id']}"  class="btn-reply click-reply glyphicon glyphicon-comment right up" style="margin-right: 2px;" aria-hidden="true"></button>
                                </div>
                            </li>
                        </foreach>
                    </ul>
                </div>
            </div>
            <div class="row pl" style="border-top:2px solid orange">
                <h4 style="border-bottom: 2px solid #FFF">最新评论</h4>
                <div>
                    <ul class="click-ul">
                        <div class="tpl-put"></div>
                        <foreach name="comment" item="comment">
                            <li>
                                <div class="col-xs-2">
                                    <img src="{$comment['userimg']}" alt="" title="" class="img-circle head">
                                </div>
                                <div class="col-xs-10">
                                    <label class="nicknameaaa" style="margin-right:15px">{$comment['nickname']|strCut=###,26}</label>
                                    <span class="" style="float: right;color:#AAA"><span class=" glyphicon glyphicon-map-marker"></span> 来自{$comment['province']}</span>
                                   <?php reply($comment['reply']) ?>
                                    <p class="user-content" style="float:left;margin-top:0px;">{$comment['content']}</p>
                                </div>
                                <div class="col-xs-12">
                                    <span class="" style="color:#AAA">{$comment['createtime']|timeFormat=###}</span>
                                    <span class="right math-right">{$comment['up']}</span>
                                    <button data-type="up" data-id="{$comment['id']}"  class="btn-reply click-up glyphicon glyphicon-thumbs-up right up" style="<?php if(cookie($comment['id']) == 1){ echo 'color:red';}else{echo 'color:#333';} ?>" aria-hidden="true"></button>
                                    <button class="right click-reply btn-reply" data-toggle="modal" data-reply="{$comment['id']}" data-reply-openid="{$comment['openid']}" data-target="#replay">回复</button>
                                    <button  data-toggle="modal" data-target="#replay" data-type="up" data-reply-openid="{$comment['openid']}" data-reply="{$comment['id']}"  class="click-reply glyphicon glyphicon-comment right up btn-reply" style="margin-right: 2px;" aria-hidden="true"></button>
                                </div>
                            </li>
                        </foreach>
                        <div class="before"></div>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<span class="limit" style="display: none">20</span>
<img src="__PUBLIC__/images/news-loading.gif" class="loading" style="width:80px;height:80px;position: fixed;top:50%;left:50%;margin-left:-40px;margin-top:-40px;display: none ">

<div class="margin-bottom"></div>
<div class="footer">
    <button type="button" class="btn" id="back" onclick="javascript:window.location.href='{:U('News/GetCode',array('column'=>$details['column']))}'"  style="background:#FFF;border:0;border-radius:0;width:20%;text-align: center;float: left"> <span class="glyphicon glyphicon-home"></span></button>
    <button type="button" class="btn"  data-toggle="modal" data-target="#myModal" id="shen" style="background:#FFF;border:0;border-radius:0;float:left;width:80%;text-align: center">我也有话说 <span class="glyphicon glyphicon-pencil"></span></button>
</div>


<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document" style="margin-top:45px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">请输入内容……</h4>
            </div>
            <div class="modal-body">
                <div class="alert alert-success" role="alert" id="send-success" style="display: none;">发表成功</div>
                <div class="alert alert-danger" role="alert" id="send-error" style="display: none;">发表失败</div>
                <textarea class="form-control" rows="1" id="content" style='overflow:scroll;overflow-y:hidden;;overflow-x:hidden'
                          onfocus="window.activeobj=this;this.clock=setInterval(function(){activeobj.style.height=activeobj.scrollHeight+'px';},200);" onblur="clearInterval(this.clock);" name="content" placeholder="你想说什么……" ></textarea>
            </div>
            <div class="modal-footer">
                <!--<button type="button" class="btn btn-default" id="face" style="float: left" data-toggle="modal" data-target="#bq">表情</button>-->
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" id="fb">发布</button>
            </div>
        </div>
    </div>
</div>



<!-- Modal -->
<div class="modal fade" id="replay" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document" style="margin-top:5px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="replay-text">回复<span id="reply-name"></span></h4>
            </div>
            <div class="modal-body">
                <input class="form-control" id="replay-content" name="content" placeholder="输入回复内容" type="text">
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" id="hf">回复</button>
            </div>
        </div>
    </div>
</div>



<div class="modal fade" id="bq" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document" style="margin-top:45px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">表情</h4>
            </div>
            <div class="modal-body">
                <ul>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                </ul>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal" data-target="#bq">关闭</button>
            </div>
        </div>
    </div>
</div>


<input type="hidden" name="id" value="{$details['id']}" id="id">
<script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script>
    $(function(){
        $('.button-width > button[type = button]').click(function(){
            var index = $(this).index();
            var vote_id = $(this).attr('data-id');
            var a = $(this);
            var id = $('#id').val();
            $.ajax({
                url:"{:U('News/GetSuppor')}",
                type:"post",
                dataType:'text',
                data:{id:id,vote_id:vote_id},
                success:function(data){
                    a.parent().find('button').remove();
                    $('#abc').html(data);
                    var aaa = $('#jjj').html();
                    $('#jjj').html(parseInt(aaa)+parseInt(1));
                }
            })
        })
        $('#fb').click(function(){
            var content = $('#content').val();
            if(content == '' || content == ''){
                alert('内容不能为空哦');
            }else{
                $.ajax({
                    url:"{:U('News/comment')}",
                    type:"post",
                    dataType:'text',
                    data:{
                        content:content,
                        tid:"{$details['id']}",
                        reply:'0',
                        column:"{$details['column']}",
                        order:"{$details['order']}"
                    },
                    success:function(data){
                        alert('发表成功！');
                        $('input[name="content"]').val('');
                        $('#content').blur();
                        $('#myModal').hide();
                        $(this).hide();
                        $('#back').show();
                        $('#shen').show();
                        $('.tpl-put').before(data);
                    }
                })
            }
        })
        $('.button-width > button').each(function(){
            $(this).click(function(){
                var isClick = $(this).parent().attr('data-click');
                if(isClick == 0){
                    $(this).parent().attr('data-click','1');
                }else{
                    alert('请不要重复表达观点哦');
                }

            })
        })
        $('.yes-left').click(function(){
            var id = "{$details['id']}";
            $.post("{:U('News/up')}",{id:id},function(data){
                if(data == 1){
                    alert('请不要重复点击哦');
                }else{
                    $('.z').html((parseInt($('.z').html())+1));
                    var count = parseInt($('.z').html())+parseInt($('.f').html());
                    $('#yes-left').css({
                        'width':(parseInt($('.z').html())/parseInt(count))*100+"%"
                    });
                    $('#yes-right').css({
                        'width':(parseInt(count)-(parseInt($('.z').html())))/parseInt(count)*100+"%"
                    });
                }
            });
        })
        $('.yes-right').click(function(){
            var id = "{$details['id']}";
            $.post("{:U('News/down')}",{id:id},function(data){
                if(data == 1){
                    alert('请不要重复点击哦');
                }else{
                    $('.f').html((parseInt($('.f').html())+1));
                    var count = parseInt($('.z').html())+parseInt($('.f').html());
                    $('#yes-right').css({
                        'width':(parseInt($('.f').html())/parseInt(count))*100+"%"
                    });
                    $('#yes-left').css({
                        'width':(parseInt(count)-(parseInt($('.f').html())))/parseInt(count)*100+"%"
                    });
                }
            });
        })
        $(document).on("click", ".click-up", function(){
            var k = $(this);
            var m = k.parent().find('.math-right');
            var mv = m.html();
            k.css('color','red');
            var comment_id = k.attr('data-id');
            var type = k.attr('data-type');
            $.post('{:U("News/top")}',{id:comment_id,type:type},function(data){
                if(data == 1){
                    alert('请不要重复点击哦');
                }else{
                    m.html(parseInt(mv)+parseInt(1))
                }
            })
        });
        $('.click-down').click(function(){
            var k = $(this);
            var m = k.parent().find('.math-left');
            var mv = m.html();
            var comment_id = k.attr('data-id');
            var type = k.attr('data-type');
            $.post('{:U("News/top")}',{id:comment_id,type:type},function(data){
                if(data == 1){
                    alert('请不要重复点击哦');
                }else{
                    k.css('color','red');
                    m.html(parseInt(mv)+parseInt(1))
                }
            })
        })
        $(document).on("click", ".click-reply", function(){
                var reply = $(this).attr('data-reply');
                $('#hf').attr('data-reply',reply);
                var replyopenid = $(this).attr('data-reply-openid');
                $('#hf').attr('data-reply-openid',replyopenid);
                var content = $(this).parent().parent().find('.user-content').html();
                $('#textarea').val(content);
                var nickname = $(this).parent().parent().find('.nicknameaaa').html();
//            alert(nickname)
            $('#reply-name').html(nickname);
        });

        $('#hf').click(function(){
            var content = $('#replay-content').val();
            if(content == '' || content == ''){
                alert('内容不能为空哦');
            }else{
                $.ajax({
                    url:"{:U('News/comment')}",
                    type:"post",
                    dataType:'text',
                    data:{
                        content:content,
                        tid:"{$details['id']}",
                        column:"{$details['column']}",
                        reply:$(this).attr('data-reply'),
                        replyopenid:$(this).attr('data-reply-openid'),
                        order:"{$details['order']}"
                    },
                    success:function(data){
                        alert('发表成功！');
                        $('#content').val('');
                        $('#content').blur();
                        $('#myModal').hide();
                        $(this).hide();
                        $('#back').show();
                        $('#shen').show();
                        $('.tpl-put').before(data);
                    }
                })
            }
        })
    })
</script>
<script>
    var _system={
        $:function(id){return document.getElementById(id);},
        _client:function(){
            return {w:document.documentElement.scrollWidth,h:document.documentElement.scrollHeight,bw:document.documentElement.clientWidth,bh:document.documentElement.clientHeight};
        },
        _scroll:function(){
            return {x:document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft,y:document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop};
        },
        _cover:function(show){
            if(show){
                this.$("cover").style.display="block";
                this.$("cover").style.width=(this._client().bw>this._client().w?this._client().bw:this._client().w)+"px";
                this.$("cover").style.height=(this._client().bh>this._client().h?this._client().bh:this._client().h)+"px";
            }else{
                this.$("cover").style.display="none";
            }
        },
        _guide:function(click){
            this._cover(true);
            this.$("guide").style.display="block";
            this.$("guide").style.top=(_system._scroll().y+5)+"px";
            window.onresize=function(){_system._cover(true);_system.$("guide").style.top=(_system._scroll().y+5)+"px";};
            if(click){_system.$("cover").onclick=function(){
                _system._cover();
                _system.$("guide").style.display="none";
                _system.$("cover").onclick=null;
                window.onresize=null;
            };}
        },
        _zero:function(n){
            return n<0?0:n;
        }
    }
</script>
<script>
    //获取滚动条当前的位置
    function getScrollTop() {
        var scrollTop = 0;
        if (document.documentElement && document.documentElement.scrollTop) {
            scrollTop = document.documentElement.scrollTop;
        }
        else if (document.body) {
            scrollTop = document.body.scrollTop;
        }
        return scrollTop;
    }

    //获取当前可是范围的高度
    function getClientHeight() {
        var clientHeight = 0;
        if (document.body.clientHeight && document.documentElement.clientHeight) {
            clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight);
        }
        else {
            clientHeight = Math.max(document.body.clientHeight, document.documentElement.clientHeight);
        }
        return clientHeight;
    }
    //获取文档完整的高度
    function getScrollHeight() {
        return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
    }

</script>
<script>
    $(function(){
        window.onscroll = function () {
            if (getScrollTop() + getClientHeight() == getScrollHeight()) {
                var id = $('#id').val();
                var limit = $('.limit').html();
                $('.loading').show();
                $.post('{:U("News/content")}', {id:id,limit:limit}, function (data) {
//                    alert(data);
                    $('.before').before(data);
                    $('.loading').hide();
                    $('.limit').html(parseInt(limit)+parseInt(20))
                });
            }
        }
        $(".content").find("img").css({"width":"100%","border-radius":"10px"});
    })
</script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
    wx.config({
        debug: false,
        appId: 'wx22c589512a2d5f61',
        timestamp:"{:JsSign()['time']}",
        nonceStr: "{:JsSign()['nonce']}",
        signature: "{:JsSign()['sign']}",
        jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo','onMenuShareQZone']
    });
    wx.ready(function(){
        wx.onMenuShareTimeline({
            title: '{$details["title"]}',
            link: '{:GetUrl()}',
            imgUrl: 'http://weixin.weirongm.com{$details["thumb"]}',
            success: function () {
                alert('好啦，客官，小渝感谢你的分享^_^');
            },
            cancel: function () {
                alert('不要啊客官，小渝还在轮回线等待分享…………');
            }
        });
        wx.onMenuShareAppMessage({
            title: '{$details["title"]}',
            desc: '{$content["content"]|cn=###}',
            link: '{:GetUrl()}',
            imgUrl: 'http://weixin.weirongm.com{$details["thumb"]}',
            type: 'link',
            success: function () {
                alert('好啦，客官，小渝感谢你的分享^_^');
            },
            cancel: function () {
                alert('不要啊客官，小渝还在轮回线等待分享…………');
            }
        });
        wx.onMenuShareQQ({
            title: '{$details["title"]}',
            desc: '{$content["content"]|cn=###}',
            link: '{:GetUrl()}',
            imgUrl: 'http://weixin.weirongm.com{$details["thumb"]}',
            success: function () {
                alert('好啦，客官，小渝感谢你的分享^_^');
            },
            cancel: function () {
                alert('不要啊客官，小渝还在轮回线等待分享…………');
            }
        });
        wx.onMenuShareWeibo({
            title: '{$details["title"]}',
            desc: '{$content["content"]|cn=###}',
            link: '{:GetUrl()}', // 分享链接
            imgUrl: 'http://weixin.weirongm.com{$details["thumb"]}',
            success: function () {
                alert('好啦，客官，小渝感谢你的分享^_^');
            },
            cancel: function () {
                alert('不要啊客官，小渝还在轮回线等待分享…………');
            }
        });
        wx.onMenuShareQZone({
            title: '{$details["title"]}',
            desc: '{$content["content"]|cn=###}',
            link: '{:GetUrl()}',
            imgUrl: 'http://weixin.weirongm.com{$details["thumb"]}',
            success: function () {
                alert('好啦，客官，小渝感谢你的分享^_^');
            },
            cancel: function () {
                alert('不要啊客官，小渝还在轮回线等待分享…………');
            }
        });
    });
    wx.error(function(res){

    });
</script>
</body>
</html>
